package com.aop.service;

import com.aop.dao.UserDao;

public class UserService {
    private UserDao userDao;

    public UserService() {
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void createUser() {
        userDao.insert();
    }

    public String updateUser(String str) {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return userDao.update(str);
    }

    public void selectById(Integer id) {
        if (1 == 1) {
            throw new RuntimeException(id + "用户已经存在");
        }
    }
}
